﻿#region NeoPatterns
// 
// NeoPatterns framework is released under LGPLv3 license.
// See http://www.opensource.org/licenses/lgpl-3.0.html for more details.
// 
// Please visit http://neopatterns.wikidot.com for more information about NeoPatterns
// 
// Copyright (c) Pascal Craponne 2008
// 
#endregion

using System;
using NeoPatterns.Core.Registry;
using NeoPatterns.Core.Registry.Implementation;

namespace NeoPatterns.Patterns.IoC
{
    /// <summary>
    /// On a field/property, specifies where to inject a dependency
    /// </summary>
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
    public sealed class InjectDependencyAttribute: Attribute
    {
        public string DependencyName { get; private set; }

        static InjectDependencyAttribute()
        {
            Application.ObjectRegistry = new ObjectRegistry();
        }

        public InjectDependencyAttribute()
        {
        }

        public InjectDependencyAttribute(string dependencyName)
        {
            DependencyName = dependencyName;
        }
    }
}